home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1995…tember: Reference Library / Dev.CD Sep 95 RL / Dev.CD Sep 95 RL.toast / mac / Technical Documentation / develop / develop Issue 15 code / Floating Windows / Infinity Windoid WDEF 3.0 / Source Code / WindoidUtil.h < prev   
Encoding:
Text File  |  1995-02-20  |  3.3 KB  |  110 lines  |  [TEXT/MMCC]

  1. // *****************************************************************************
  2. //
  3. //    WindoidUtil.h
  4. //
  5. // —————————————————————————————————————————————————————————————————————————————
  6. //    Copyright © 1991-95 Infinity Systems.  All rights reserved.
  7. // —————————————————————————————————————————————————————————————————————————————
  8. #ifndef Infinity_WINDOIDUTIL
  9. #define Infinity_WINDOIDUTIL
  10.  
  11. #include "WindoidDefines.h"
  12.  
  13. #include <QuickDraw.h>
  14. #include <Types.h>
  15. #include <Windows.h>
  16.  
  17.  
  18. // —————————————————————————————————————————————————————————————————————————————
  19. //
  20. //    Macros to make code cleaner
  21. //
  22. // —————————————————————————————————————————————————————————————————————————————
  23. #define IsOdd(value)  ((value) & 1)
  24. #define IsEven(value) (!IsOdd(value))
  25.  
  26.  
  27. // —————————————————————————————————————————————————————————————————————————————
  28. //
  29. //    Generally useful routines
  30. //
  31. // —————————————————————————————————————————————————————————————————————————————
  32. Boolean HasSystem7();
  33.  
  34. Boolean HasCQDraw();
  35.  
  36. void SyncPorts();
  37.  
  38.  
  39. // —————————————————————————————————————————————————————————————————————————————
  40. //
  41. //    OurDeviceLoop
  42. //
  43. // —————————————————————————————————————————————————————————————————————————————
  44. #if !defined(USESROUTINEDESCRIPTORS) && !defined(GENERATINGCFM)
  45.     // Support for non-Universal Headers.
  46.     typedef DeviceLoopDrawingProcPtr DeviceLoopDrawingUPP;
  47. #endif
  48.  
  49. #if SystemSevenOrLater
  50.     #define OurDeviceLoop(drawingRgn, drawingProc, userData, flags)    \
  51.                DeviceLoop(drawingRgn, drawingProc, userData, flags)
  52. #else
  53.     void OurDeviceLoop(RgnHandle drawingRgn, DeviceLoopDrawingUPP drawingProc,
  54.                        long userData, DeviceLoopFlags flags);
  55. #endif
  56.  
  57.  
  58. // —————————————————————————————————————————————————————————————————————————————
  59. //
  60. //    Window Color Table color access
  61. //
  62. // —————————————————————————————————————————————————————————————————————————————
  63. void WctbForeColor(WindowPeek window, short partCode);
  64.  
  65. void WctbBackColor(WindowPeek window, short partCode);
  66.  
  67. void AvgWctbForeColor(WindowPeek window, short light, short dark, short shade);
  68.  
  69. void AvgWctbBackColor(WindowPeek window, short light, short dark, short shade);
  70.  
  71. void ColorsNormal();
  72.  
  73.  
  74. // —————————————————————————————————————————————————————————————————————————————
  75. //
  76. //    CheckDisplay
  77. //
  78. // —————————————————————————————————————————————————————————————————————————————
  79. //        Determine if the device is adequate for drawing in color with System 7.
  80. // —————————————————————————————————————————————————————————————————————————————
  81. Boolean CheckDisplay(short theDepth, short deviceFlags, GDHandle targetDevice, 
  82.                      WindowPeek window);
  83.  
  84.  
  85. // —————————————————————————————————————————————————————————————————————————————
  86. //
  87. //    General utility drawing routines
  88. //
  89. // —————————————————————————————————————————————————————————————————————————————
  90. void MoveRectTo(Rect *theRect, short left, short top);
  91.  
  92. void FrameBox(const Rect *theRect);
  93.  
  94. void FrameTopLeftShading(Rect theRect);
  95.  
  96. void FrameBottomRightShading(Rect theRect);
  97.  
  98.  
  99. // —————————————————————————————————————————————————————————————————————————————
  100. //
  101. //    Window position/size access
  102. //
  103. // —————————————————————————————————————————————————————————————————————————————
  104. void GetGlobalMappingPoint(WindowPeek window, Point *thePoint);
  105.  
  106. void GetGlobalContentRect(WindowPeek window, Rect *contentRect);
  107.  
  108.  
  109. // —————————————————————————————————————————————————————————————————————————————
  110. #endif